home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-06-27 | 2.6 KB | 85 lines | [TEXT/MPCC] |
- //
- // NuDrivers.h
- //
-
- #ifndef _NuDrivers_
- #define _NuDrivers_ 1
-
- typedef long DriverDescVersion;
- typedef long DriverVersion;
- typedef OSType DriverDescSignature;
-
- enum
- {
- theDescriptionSignature = 'mtej' // must appear in first long
- }; // of DriverDescription
-
- typedef struct DriverDescription {
- DriverDescSignature driverDescSignature; // Signature field of this structure
- DriverDescVersion driverDescVersion; // Version of this data structure
- OSType driverDeviceFamilyType; // Family of devices
- OSType driverType; // Type of driver within the family
- OSType driverSubType; // SubType of driver within family
- OSType driverManufacturer; // Maker of this driver
- DriverVersion driverVersion; // Maker's driver version
- Boolean driverIsAgent; // Future use only
- Boolean driverIsConcurrent; // Driver handles concurrent requests
- char driverNameLength; // Length of driver's name
- char driverName[32]; // Driver's name
- long driverReservedLength; // length of reserved area
- char driverDescReserved[4]; // Reserved area for the future
- } DriverDescription, *DriverDescriptionPtr;
-
- typedef unsigned long IOCommandCode;
- enum
- {
- OpenCmd, // The Driver Open Command
- CloseCmd, // The Driver Close Command
- ReadCmd, // The Driver Read Command
- WriteCmd, // The Driver Write Command
- ControlCmd, // The Driver Control Command
- StatusCmd, // The Driver Status Command
- KillIOCmd, // The Driver KillIO Command
- InitializeCmd, // The Driver Initialize Command
- FinalizeCmd // The Driver Finalize Command
- };
-
- typedef unsigned long IOCommandID;
-
- typedef unsigned long IOCommandKind;
- enum
- {
- SynchronousIOCommandKind = 0x00000001,
- AsynchronousIOCommandKind = 0x00000002,
- ImmediateIOCommandKind = 0x00000004
- };
-
- typedef unsigned long DeviceNodeID;
-
- typedef struct InitializationInfo {
- DCtlPtr theDce;
- DeviceNodeID theDeviceNode;
- } InitializationInfo, *InitializationInfoPtr;
-
- typedef struct FinalizationInfo {
- DCtlPtr theDce;
- DeviceNodeID theDeviceNode;
- } FinalizationInfo, *FinalizationInfoPtr;
-
- // Contents are command specific
-
- typedef union {
- ParmBlkPtr thePb; // Value for OPEN, CLOSE, READ, WRITE, etc,...
- InitializationInfoPtr theInitialInfo; // Value for INITIALIZE
- FinalizationInfoPtr theFinalInfo; // Value for FINALIZE
- } IOCommandContents;
-
- typedef OSErr (NuDriverEntryPoint) ( IOCommandID theID,
- IOCommandContents theContents,
- IOCommandCode theCode,
- IOCommandKind theKind );
-
- typedef NuDriverEntryPoint *NuDriverEntryPointPtr;
-
- #endif
-